<h3>Leaves Applied </h3>

<table width="100%" class="table table-hover" >
  <thead>
  <tr>
    <th>Person</th>
    <th>For Date</th>
    <th>Applied Date</th>
    <th>Reason</th>
    <th>Status</th>
    <th>Action</th>
  </tr>
  </thead>
 <tbody>
  <?php 
  foreach($all_leave as $leaves) {?>
<tr>
<td style="font-weight:bold"><?= $leaves->username?></td>
<td><?= $leaves->leave_date?></td>
<td><?= $leaves->date_applied?></td>
<td><?= $leaves->reason?></td>
<td style="font-weight:bold">
<?php
if($leaves->status == 'pending')
{
echo '<span class="text-error"> <a href="'.site_url('founder/leave_management/edit_leave_status/'.$leaves->id).'" rel="tooltip" title="Edit Leave" class="grant_leave text-error" >'.$leaves->status.'</a></span>';	
}
else
{
	echo '<span class="text-success"> <a href="'.site_url('founder/leave_management/edit_leave_status/'.$leaves->id).'" rel="tooltip" title="Edit Leave" class="grant_leave text-success" >'.$leaves->status.'</a></span>';	
}
 ?>
</td>
<td><a href="<?= site_url('founder/leave_management/edit_leave_status/'.$leaves->id);?>" rel="tooltip" title="Edit Leave" class="grant_leave" ><i class="icon-pencil"></i></a></td>
</tr>
  <?php }?>
</tbody>
</table>

<script type="text/javascript">

$('.grant_leave').click(function(event) {	
  event.preventDefault();
  $.get(this.href, function(html) {
  $(html).appendTo('body').modal(); 
  });
});

</script>
